1) Database - collection of related data or the software used in databases to store , organize and retrieve the data
2) Fields - information entered into the database via field
3) Records - grouped field
4) Files - grouped files
5) query - allow you to extract information according to certain conditions
6) Primary Key - a unique key that can uniquely identify each row in a table.
Student Number
First Name
Last name
Homeroom
- The student number is an example of a primary key
7) Candidate Key - is a special subset of superkeys that do not have any extraneous information in them.
Employee Number
Employee Start Date
Project Code
Project Name
Total Days On Project
- In this example, the Employee number and the Employee Start Date are candidate keys.
8) Foreign key - is the data entry which is a primary key on another table.
Normal Forms
1. first normal form
-no repeating columns of data
-no duplicated row of data *Example
Student ID
First name
Last name
course
1
SuJin
You
Chemistry 11, English 11
2
John
Kim
Biology 11
3
Yoona
Lee
Math 11
According to the First Normal Form, there should'nt be repeating columns of data or duplicated rows of data
However, in this chart, one student has two course name in a row which has to be seperated.
You can seperate this chart into two charts, each titled Student and Course
*Solution
Student
Student ID
First name
Last name
1
SuJin
You
2
John
Kim
3
Yoona
Lee
PK = Student ID
Course
Course ID
Student ID
Course name
1
1
Chemistry 11
2
1
English 11
3
2
Biology 11
4
3
Math 11
PK = Course ID
FK = Student ID
2. second normal form
-each attribute is dependant on the entrie primary key
*Example
Student ID
First name
Block
Course
1
SuJin
1-2
English 11
2
John
1-2
BCA 11
3
Alex
1-2
Math 11
The primary key of one table is the foreign key of the other table.
*Solution
Student
Student ID
First name
1
Sujin
2
John
3
Alex
PK= Student ID
Course
Student ID
Block
Course
1
1-2
English 11
2
1-2
BCA 11
3
1-2
Math 11
PK=Block
FK=Student ID
3. third normal form
-each attribute in only dependent on the primary key
Definition
1) Database - collection of related data or the software used in databases to store , organize and retrieve the data
2) Fields - information entered into the database via field
3) Records - grouped field
4) Files - grouped files
5) query - allow you to extract information according to certain conditions
6) Primary Key - a unique key that can uniquely identify each row in a table.
7) Candidate Key - is a special subset of superkeys that do not have any extraneous information in them.
8) Foreign key - is the data entry which is a primary key on another table.
Normal Forms
1. first normal form-no repeating columns of data
-no duplicated row of data
*Example
English 11
According to the First Normal Form, there should'nt be repeating columns of data or duplicated rows of data
However, in this chart, one student has two course name in a row which has to be seperated.
You can seperate this chart into two charts, each titled Student and Course
*Solution
Student
Course
FK = Student ID
2. second normal form
-each attribute is dependant on the entrie primary key
*Example
*Solution
Student
Course
FK=Student ID
3. third normal form
-each attribute in only dependent on the primary key
Example)
Nobel Prize Winner
Entity Relationship Diagrams
http://www.phpwebcommerce.com/shopping-cart-database-design.php
*a primary key can never contain a null value(=value with no content)
*a non-primary key can contain a null value
1)One to one
- one product has one product name
- one supplier has one contact name
2)One to many
- one shipper can ship many products
3)Many to Many
- one user can prick many products
- one product can be ordered by many users